<?php

namespace common\components;

use yii\helpers\ArrayHelper;
use yii\rest\ActiveController;

/**
 * REST基础控制器类
 *
 * @package common\components
 */
class RestController extends ActiveController
{

    public function actions()
    {
        return ArrayHelper::merge(parent::actions(), [
            'index' => [
                'class' => 'yii\rest\IndexAction',
            ],
            'view' => [
                'class' => 'yii\rest\ViewAction',
            ],
            'create' => [
                'class' => 'common\components\rest\CreateAction',
            ],
            'update' => [
                'class' => 'yii\rest\UpdateAction',
            ],
            'delete' => [
                'class' => 'yii\rest\DeleteAction',
            ],
            'options' => [
                'class' => 'yii\rest\OptionsAction',
            ],
        ]);
    }
}
